package com.zr.daoimp;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import net.sf.json.JSONArray;

import com.zr.dao.QrmmDao;
import com.zr.model.gwc;
import com.zr.util.JDBCUtil;

public class QrmmDaoimpl implements QrmmDao {

	@Override
	public boolean checknub(int nub, String psd) {
		boolean flag=false;
		StringBuffer sb=new StringBuffer();
		sb.append(" SELECT * FROM dcxt_login WHERE uid=?");
		Connection con=JDBCUtil.getConnection();
		try {
			PreparedStatement pps=con.prepareStatement(sb.toString());
			pps.setInt(1,nub);
			ResultSet rs=pps.executeQuery();
			if(rs.next()){
				if(rs.getString("upassword").equals(psd)){
					flag=true;
			}else{
				flag=false;
			}
			}
			JDBCUtil.closeJDBC(pps, con);
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		// TODO Auto-generated method stub
		return flag;


	}

}
